<?php

define('THIS_DIR', dirname(realpath(__FILE__)));
error_reporting(E_ALL);

$pageXML = new DOMDocument();
$pageXML->load(THIS_DIR.'/data.xml');

$xsl_dom = new DOMDocument();
$xsl_dom->load(THIS_DIR.'/template.xsl');
$xslt = new XSLTProcessor();
$xslt->importStylesheet($xsl_dom);

header('Content-Type: text/html; charset="UTF-8"');
echo $xslt->transformToXml($pageXML);;

?>